<script type="text/javascript">


ddaccordion.init({
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})


</script>
<?php
/*
if (!defined('CMS_SYSTEM')) exit;

global $Default_Temp;
$bl_arr = array();
$bl_arr[] = $bl_l;
$bl_arr[] = $bl_r;
$basename = pathinfo(__FILE__, PATHINFO_BASENAME);
$correctArr = array();
for ($i = 0; $i < count($bl_arr); $i++) {
	for ($h = 0; $h < count($bl_arr[$i]); $h++) {
		$temp = explode("@", $bl_arr[$i][$h]);
		if (($temp[5] == $currentlang) && ($temp[6] == $basename)) {
			$correctArr = $temp;
			break;
		}
	}
}
$content = '';
$content .= "<div class=\"div-block\">\n";
$content .= "<div class=\"div-tblock\">{$correctArr[1]}</div>\n";
$content .= "<div id=\"ddsidemenubar\" class=\"arrowlistmenu\">\n";
$i=1;
$result = $db->sql_query("SELECT catid, title  FROM {$prefix}_products_cat WHERE parentid=0 and alanguage='$currentlang' order by weight asc");
if($db->sql_numrows($result) > 0) {
	while (list($idpc, $titlepc) = $db->sql_fetchrow($result)) {
		$content .= "<div class=\"menuheader expandable\"><a href=\"index.php?f=products&do=categories&catid=$idpc\"  rel=\"ddsubmenuside$i\" style=''>$titlepc</a></div>";
		
		$j=1;
		$result_sub = $db->sql_query("SELECT catid, title FROM {$prefix}_products_cat WHERE parentid=0 and alanguage='$currentlang' order by weight asc");
		if($db->sql_numrows($result_sub) > 0) 
		
		{
			while (list($idpc_sub, $titlepc_sub) = $db->sql_fetchrow($result_sub)) {
		
				$result_sub2 = $db->sql_query("SELECT catid, title FROM {$prefix}_products_cat WHERE parentid='$idpc_sub' and alanguage='$currentlang' order by weight asc");
				if($db->sql_numrows($result_sub2) > 0) {
		
					$content .= "<ul class=\"categoryitems\">";
					while (list($idpc_sub2, $titlepc_sub2) = $db->sql_fetchrow($result_sub2)) 					{
						$content .= "<li><a href=\"index.php?f=products&do=categories&catid=$idpc_sub2\">$titlepc_sub2</a></li>";
		
					}
					$content.="</ul>";
					
				//	$j++;
				//	$content .= "</ul>";
				//}
				//else
				//{
					//$content .= "<ul  class=\"categoryitems\"><li></li></ul>";
				//	$j++;
				//}
			}
			
		}
		
				
	}
	
	$i++;
	
	$content .= "<script type=\"text/javascript\">ddlevelsmenu.setup(\"ddsidemenubar\", \"sidebar\") //ddlevelsmenu.setup(\"mainmenuid\", \"topbar|sidebar\")</script>";
	}
}
$content.="</div>";
$content .= "</div>";
*/
?>

<?php

if (!defined('CMS_SYSTEM')) exit;

global $Default_Temp;

$content = '';
$bl_arr = array();
$bl_arr[] = $bl_l;
$bl_arr[] = $bl_r;
$basename = pathinfo(__FILE__, PATHINFO_BASENAME);
$correctArr = array();
for ($i = 0; $i < count($bl_arr); $i++) {
	for ($h = 0; $h < count($bl_arr[$i]); $h++) {
		$temp = explode("@", $bl_arr[$i][$h]);
		if (($temp[5] == $currentlang) && ($temp[6] == $basename)) {
			$correctArr = $temp;
			break;
		}
	}
}

$content .= "<div class=\"div-block\">\n";
$content .= "<div class=\"div-tblock\">{$correctArr[1]}</div>\n";
//$content .= "<div class=\"div-cblock\">";
$content .= "<div id=\"ddsidemenubar\" class=\"arrowlistmenu\">\n";

$i=1;
$result = $db->sql_query("SELECT catid, title FROM {$prefix}_products_cat WHERE parentid=0 and active=1 and alanguage='$currentlang' order by weight asc");
if($db->sql_numrows($result) > 0) 
{
	while (list($id, $title) = $db->sql_fetchrow($result)) 
	{
		$result_check = $db->sql_query("SELECT catid, title FROM {$prefix}_products_cat WHERE parentid=$id and active=1 and alanguage='$currentlang' order by weight asc");
		
			if ($db->sql_numrows($result_check) > 0)
				$content .= "<div class=\"menuheader expandable\"><a href=\"index.php?f=products&do=categories&catid=$id\">$title</a></div>\n";
			else
				$content .= "<div class=\"menuheader expandable\"><a href=\"index.php?f=products&do=categories&catid=$id\"></div>\n";
		
		
		
		$result_sub = $db->sql_query("SELECT catid, title FROM {$prefix}_products_cat WHERE parentid=$id and active=1 and alanguage='$currentlang' order by weight asc");
		if($db->sql_numrows($result_sub) > 0) 
		{
			$content .= "<ul class=\"categoryitems\">\n";
			while (list($id_sub, $title_sub) = $db->sql_fetchrow($result_sub)) 
			{
				$content .= "<li><a href=\"index.php?f=products&do=categories&catid=$id_sub\">-- $title_sub</a>\n";
				$result_sub2 = $db->sql_query("SELECT catid, title FROM {$prefix}_products_cat WHERE parentid=$id_sub and active=1 and alanguage='$currentlang' order by weight asc");
				if($db->sql_numrows($result_sub2) > 0) 
				{
					$content .= "<ul class=\"categoryitems\">\n";
					while (list($id_sub2, $title_sub2,) = $db->sql_fetchrow($result_sub2)) 
					{
						$content .= "<li><a href=\"index.php?f=products&do=categories&catid=$id_sub\">$title_sub2</a>-- $title_sub2</a></li>\n";
					}
					$content .= "</ul>\n";
				}
				$content .= "</li>\n";
			}
			$content .= "</ul>\n";
		}
		$i++;
	}
	$content .= "</div>
	<script type=\"text/javascript\">ddlevelsmenu.setup(\"ddsidemenubar\", \"sidebar\") //ddlevelsmenu.setup(\"mainmenuid\", \"topbar|sidebar\")</script>\n";
}
	//$content .= "</div>";
$content .= "</div>";
?>


